/**
 * N*N的棋盘，三种操作：
 * 1. 放一个车到xy
 * 2. 把xy位置的车拿走
 * 3. 给定一个矩形，问里面的每一格是否都被车攻击
 * 第x行放一个车，则将x位置改为1，要看[s, e]中的每一行是否被攻击
 * 只需要[s, e]的区间和恰好等于 e - s + 1 即可
 * 列同理
 */
#include <bits/stdc++.h>
using namespace std;
 
char *__abc147, *__xyz258, __ma369[100000];
#define __hv007() ((__abc147==__xyz258) && (__xyz258=(__abc147=__ma369)+fread(__ma369,1,100000,stdin),__abc147==__xyz258) ? EOF : *__abc147++)
 
int getInt(){
	int sgn = 1;
	char ch = __hv007();
	while( ch != '-' && ( ch < '0' || ch > '9' ) ) ch = __hv007();
	if ( '-' == ch ) {sgn = 0;ch=__hv007();}
 
	int ret = (int)(ch-'0');
	while( '0' <= (ch=__hv007()) && ch <= '9' ) ret = ret * 10 + (int)(ch-'0');
	return sgn ? ret : -ret;
}
 
#ifndef ONLINE_JUDGE
int const SIZE = 13;
#else
int const SIZE = 1E5+5;
#endif
 
using llt = long long;
using Real = long double;
using vi = vector<int>;
using pii = pair<int, int>;

int N, Q;

int Sr[SIZE], Sc[SIZE];

struct _t{

int n;
int c[SIZE];

int lowbit(int x){return x & -x;}

void init(int _n){n=_n;memset(c, 0, sizeof(n));}

void modify(int pos, int d){
	while(pos <= n){
		c[pos] += d;
		pos += lowbit(pos);
	}
}

int query(int pos){
	int ans = 0;
	while(pos) ans += c[pos], pos -= lowbit(pos);
	return ans;
}

int query(int s, int e){return query(e) - query(s-1);}

}Br, Bc;
 
int main(){
#ifndef ONLINE_JUDGE
    freopen("1.txt", "r", stdin);
#endif
    N = getInt(); Q = getInt();
	Br.init(N); Bc.init(N);

	for(int op,q=1;q<=Q;++q){
        if(1 == (op = getInt())){
            int x = getInt();
			int y = getInt();
			if(1 == ++Sr[x]){
                Br.modify(x, 1);
			}
			if(1 == ++Sc[y]){
                Bc.modify(y, 1);
			}
		}else if(2 == op){
            int x = getInt();
			int y = getInt();
			if(0 == --Sr[x]){
                Br.modify(x, -1);
			}
			if(0 == --Sc[y]){
                Bc.modify(y, -1);
			}
		}else{
            int x1 = getInt();
			int y1 = getInt();
			int x2 = getInt();
			int y2 = getInt();
			int r = Br.query(x1, x2);
			int c = Bc.query(y1, y2);
			puts(x2-x1+1==r||y2-y1+1==c?"Yes":"No");
		}
	}
    return 0;
}